#include "brushitem.h"
#include <QPainter>
BrushItem::BrushItem(QGraphicsItem* parent):
       QGraphicsItem(parent),
       m_startpt(QPoint(0,0)),
       m_endpt(QPoint(0,0))
{
    m_paletteImage = new QImage(465,360,QImage::Format_ARGB32);
    m_paletteImage->fill(0);
}

void BrushItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{   
    painter->drawImage(0,0,*m_paletteImage);
}

QRectF BrushItem::boundingRect() const
{
   return QRectF(0,0,465,360);
}

void BrushItem::newImage()
{
    m_paletteImage->fill(0);
    update();
}
